package cn.simple.base.component;

import javax.swing.*;

/**
 * 退出按钮
 */
public class ExitJButton extends JButton {

    public ExitJButton(Icon icon) {
        super(icon);
        addActionListener(e -> exit());
    }

    public ExitJButton(String text) {
        super(text);
        addActionListener(e -> exit());
    }

    public ExitJButton(String text, Icon icon) {
        super(text, icon);
        addActionListener(e -> exit());
    }

    private void exit() {
        System.exit(1);
    }

}
